/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giftmemo.ui.utils;

import com.alee.laf.rootpane.WebFrame;
import java.awt.Container;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 *
 * @author Egor
 */
public class BasicFrame extends WebFrame {

    public BasicFrame() {
        init();
    }

    private void init() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public void setContent(JComponent... content) {
        JPanel contPanel = new JPanel();
        contPanel.setLayout(new BoxLayout(contPanel, BoxLayout.Y_AXIS));
        for (int i = 0; i < content.length; i++) {
            JComponent jComponent = content[i];
            contPanel.add(jComponent);
        }
        getContentPane().add(contPanel);
        pack();
    }

    public void showFrame() {
        setVisible(true);
    }

    public void closeFrame() {
        setVisible(false);
    }
}
